/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 80017
 Source Host           : localhost:3306
 Source Schema         : gray

 Target Server Type    : MySQL
 Target Server Version : 80017
 File Encoding         : 65001

 Date: 12/07/2020 00:53:24
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for deploy_log
-- ----------------------------
DROP TABLE IF EXISTS `deploy_log`;
CREATE TABLE `deploy_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `project_name` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目名',
  `today_count` int(5) DEFAULT NULL COMMENT '今日发布次数',
  `deploy_desc` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '发布描述',
  `status` int(2) DEFAULT NULL COMMENT '1.ok 2.fail',
  `op_user` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `create_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='发布日志记录';

-- ----------------------------
-- Records of deploy_log
-- ----------------------------
BEGIN;
INSERT INTO `deploy_log` VALUES (1, 'dbo', 2, '增加池化设计', 1, 'admin', '2020-07-05 20:23:18', '2020-07-05 20:23:18');
COMMIT;

-- ----------------------------
-- Table structure for deploy_opt
-- ----------------------------
DROP TABLE IF EXISTS `deploy_opt`;
CREATE TABLE `deploy_opt` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `opt_name` varchar(20) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机器名',
  `opt_addr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'Git源码部署路径',
  `host` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机器ip',
  `opt_desc` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '说明',
  `opt_scp_first` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '远端机器\n是否第一次部署',
  `username` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `password` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `port` int(10) DEFAULT '22',
  `pwd_type` int(5) DEFAULT NULL COMMENT '访问类型 1 密码;2 秘钥',
  `create_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='机器集群表';

-- ----------------------------
-- Records of deploy_opt
-- ----------------------------
BEGIN;
INSERT INTO `deploy_opt` VALUES (1, 'star11', '/Users/pengwang/Documents/gray_opt_test/', '127.0.0.1', NULL, 'yes', NULL, NULL, NULL, NULL, '2020-01-11 03:08:37', '2020-01-11 03:08:37');
INSERT INTO `deploy_opt` VALUES (2, 'o', '/opt/gray_test/', '172.18.0.3', NULL, 'no', 'root', '123456', 22, NULL, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (3, '212', '/21', '0.9', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (4, 'front11', '/opt/gits/', '127.0.0.1', '没有说明', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (6, '本机', '/Users/pengwang/Documents/gray_opt_test/', '127.0.0.1', '本机部署', NULL, 'admin', 'admin', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (23, '21', '21', '21', '21', NULL, '21', '21', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (24, '2', '2', '22', '2', NULL, '2', '', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (25, '', '', '', '', NULL, '', '', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (26, '', '', '', '', NULL, '', '', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (27, '', '', '', '', NULL, '', '', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (28, '', '', '', '', NULL, '', '', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (29, '', '', '', '', NULL, '', '', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (30, '', '', '', '', NULL, '', '', NULL, 1, NULL, NULL);
INSERT INTO `deploy_opt` VALUES (31, '', '', '', '', NULL, '', '', NULL, 1, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for project_log
-- ----------------------------
DROP TABLE IF EXISTS `project_log`;
CREATE TABLE `project_log` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `project_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `log_path` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '日志地址',
  `opt_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '日志文件',
  `create_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='项目部署日志表';

-- ----------------------------
-- Records of project_log
-- ----------------------------
BEGIN;
INSERT INTO `project_log` VALUES (1, 'admin-web', '/opt/nfs/star12/admin-web/log/', 'star11', '2019-08-31 23:35:32', '2019-08-31 23:35:45');
INSERT INTO `project_log` VALUES (2, 'message-center', '/opt/nfs/star12/message-centerlog/', 'stdout.log', '2019-08-31 23:35:36', '2019-08-31 23:35:49');
INSERT INTO `project_log` VALUES (3, 'solr-client', '/opt/nfs/star12/solr-client/log/', 'stdout.log', '2019-08-31 23:35:41', '2019-08-31 23:35:53');
INSERT INTO `project_log` VALUES (4, 'qq', NULL, 'qq_stdout_log.log', NULL, NULL);
INSERT INTO `project_log` VALUES (5, 'api-channel', '/opt/logs/api-channel', '本机', NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for projects
-- ----------------------------
DROP TABLE IF EXISTS `projects`;
CREATE TABLE `projects` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `project_name` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `git_addr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目git地址',
  `build_way` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '构建方式',
  `project_lan` int(5) DEFAULT NULL COMMENT '项目语言 1.Java 2.Python 3.Go',
  `project_desc` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目描述',
  `install_type` int(3) DEFAULT NULL COMMENT '打包类型 1.jar 2.war 3.other',
  `opt_id` int(11) DEFAULT NULL COMMENT '部署机器',
  `log_path` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '项目日志地址',
  `status` int(3) DEFAULT '1' COMMENT '1.停止 2.在启用',
  `create_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='项目构建表';

-- ----------------------------
-- Records of projects
-- ----------------------------
BEGIN;
INSERT INTO `projects` VALUES (1, 'dbo', 'https://gitee.com/jasonpe/dbo.git', 'git源码构建', 1, '封装jdbc操作数据库的轮子', 1, 1, NULL, 1, '2019-08-31 23:29:22', '2019-08-31 23:29:27');
INSERT INTO `projects` VALUES (2, 'netty-channel', 'https://gitee.com/jasonpe/netty-channel.git', 'git源码构建', 1, '自定义一个tcp通讯的模型', 1, 1, NULL, 1, '2019-08-31 23:31:40', '2019-08-31 23:31:46');
INSERT INTO `projects` VALUES (3, 'gray', 'https://gitee.com/jasonpe/gray.git', 'git源码构建', 2, '自定义python的灰度测试发布', 3, 1, NULL, 2, '2019-08-31 23:32:55', '2019-08-31 23:33:01');
INSERT INTO `projects` VALUES (8, 'drools-demo', 'https://gitee.com/jasonpe/drools-demo.git', 'git源码构建', 1, 'ceshi', 1, 2, NULL, NULL, NULL, NULL);
INSERT INTO `projects` VALUES (9, 'qq', 'qq', 'git源码构建', 1, 'qq', 1, 1, NULL, NULL, NULL, NULL);
INSERT INTO `projects` VALUES (10, 'api-channel', 'git@code.aliyun.com:pampa-bang/api-channel.git', 'git源码构建', 1, 'benji', 1, 6, '/opt/logs/api-channel', NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `gender` int(3) DEFAULT NULL COMMENT '1 男;2 女',
  `deploy_count` int(3) DEFAULT NULL COMMENT '发布次数',
  `use_count` int(3) DEFAULT NULL COMMENT '已使用次数',
  `user_ auth` int(10) DEFAULT NULL COMMENT '账号权限\n1 管理员;2.test 3.dev',
  `create_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
INSERT INTO `users` VALUES (1, 'admin', 'admin', 1, 10, 1, 1, '2019-09-01 19:55:02', '2019-09-01 19:55:08');
INSERT INTO `users` VALUES (2, 'bob', '123456', 1, 2, 0, 2, '2019-09-01 19:54:59', '2019-09-01 19:54:59');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
